<script>
import outMain from "@/components/outMain.vue";
import { ElMessage, ElMessageBox } from "element-plus";

import { signDetails } from "@/http/api";

export default {
  components: { outMain },
  name: "",
  data() {
    return {
      detailId: this.$route.query.id,
      formData: {},
    };
  },
  props: {},
  setup() {},
  methods: {
    linkFn(url, id, type) {
      this.$router.push({ path: url, query: { id: id, type: type } });
    },
    getData() {
      signDetails({ user_training_sign_id: this.detailId }).then((res) => {
        if (res.data.code == 1) {
          this.formData = res.data.data;
        }
      });
    },
    backFn() {
      this.$router.back();
    },
  },
  mounted() {},
  created() {
    this.getData();
  },
};
</script>
<template>
  <outMain>
    <div class="formCont">
      <div class="formStep">
        <div class="formHead">
          <div>培训报名详情</div>
          <btn value="返回上一级" @ok="backFn"></btn>
        </div>
        <div class="formMain">
          <div class="stepCont">
            <div class="formDes">
              <div class="desTitle">报名信息</div>
              <div class="desCont">
                <div class="desItem">
                  <div class="desName">报名编号</div>
                  <div class="desText">{{ formData.sign_number }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">学员姓名</div>
                  <div class="desText">{{ formData.real_name }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">手机号</div>
                  <div class="desText">{{ formData.mobile }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">身份证号</div>
                  <div class="desText">{{ formData.id_card }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">培训合计费用</div>
                  <div class="desText">{{ formData.total_money }}元</div>
                </div>
                <div class="desItem">
                  <div class="desName">已交定金</div>
                  <div class="desText">{{ formData.pay_money }}元</div>
                </div>
                <div class="desItem">
                  <div class="desName">缴费状态</div>
                  <div class="desText">
                    <el-tag type="warning" v-if="formData.pay_status == 1"
                      >待支付</el-tag
                    >
                    <el-tag v-if="formData.pay_status == 2">待使用</el-tag>
                    <el-tag type="info" v-if="formData.pay_status == 3"
                      >已取消</el-tag
                    >
                    <el-tag type="success" v-if="formData.pay_status == 4"
                      >已完成</el-tag
                    >
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">收货人</div>
                  <div class="desText">{{ formData.zs_shr || "- -" }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">收货手机号</div>
                  <div class="desText">{{ formData.zs_mobile || "- -" }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">收货地址</div>
                  <div class="desText">{{ formData.zs_city || "- -" }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">详细地址</div>
                  <div class="desText">{{ formData.zs_address || "- -" }}</div>
                </div>
                <div class="desItem">
                  <div class="desName">创建时间</div>
                  <div class="desText">{{ formData.create_time }}</div>
                </div>
              </div>
            </div>
            <div class="formDes" v-if="formData.training_content">
              <div class="desTitle">培训信息</div>
              <div class="desCont">
                <div class="desItem">
                  <div class="desName">培训项目</div>
                  <div class="desText">
                    <span
                      class="linkText_"
                      @click="
                        linkFn('/workListDetail', formData.training_content_id)
                      "
                    >
                      {{ formData.training_content.training_name }}
                    </span>
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">培训时长</div>
                  <div class="desText">
                    {{ formData.training_content.training_time }}
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">开班时间</div>
                  <div class="desText">
                    {{ formData.training_content.training_sk_time }}
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">报道时间</div>
                  <div class="desText">
                    {{ formData.training_content.report_time }}
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">考试时间</div>
                  <div class="desText">
                    {{ formData.training_content.training_ks_time }}
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">培训学校</div>
                  <div class="desText">
                    {{ formData.training_content.training_school_name }}
                  </div>
                </div>
                <div class="desItem">
                  <div class="desName">学校地址</div>
                  <div class="desText">
                    {{ formData.training_content.training_address }}
                  </div>
                </div>
              </div>
            </div>
            <div class="formDes" v-if="formData.training_content">
              <div class="desTitle">费用信息</div>
              <div class="desCont">
                <div
                  class="desItem"
                  :key="index"
                  v-for="(item, index) in formData.training_content
                    .tuition_fee_data"
                >
                  <div class="desName">{{ item.name }}</div>
                  <div class="desText">{{ item.money ? item.money : 0 }}元</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </outMain>
</template>
<style scoped lang="less"></style>
